//
//  InstallationDetailSystemDetailForPanelModel.swift
//  ezyform
//
//  Created by MoennigQ on 17/6/21.
//  Copyright © 2021 Client.Solution Pty Ltd. All rights reserved.
//

import Foundation
import HandyJSON
import RxSwift
class InstallationDetailSystemDetailForPanelModel: NSObject, HandyJSON,Copying {
    var id: Int64 = 0//是pvd detail中此，system->Panel数据的主键
    var brand: String = ""
    @objc dynamic var model: String = ""
    @objc dynamic var watts_per_panel: Int64 = 0
    @objc dynamic var number_panels: Int64 = 0
    var output: String {
        let value: Double = Double(watts_per_panel) * Double(number_panels) / 1000
        return Tool().formatAmountToStr(amount: "\(value)",maximumFractionDigits: 3, minimumFractionDigits: 0)
    }
    //字典中panel的id,用于修改panel信息上传用
    var panel_brand_id: Int64 =  0//对应一个model
    //删除标记
    var deleted_at: Bool = false
    var valid_flag: Bool = true//true,表示当前model是无效的，因为改了安装日期，可能会变成无效的
    var approved_date: String = ""//审核通过时间
    var expiry_date: String = ""//过期时间
    required override init() {
        
    }
    required init(original: InstallationDetailSystemDetailForPanelModel) {
        id = original.id
        brand = original.brand
        model = original.model
        watts_per_panel = original.watts_per_panel
        number_panels = original.number_panels
        panel_brand_id = original.panel_brand_id
        deleted_at = original.deleted_at
    }
            
}
